<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <!--相当于引入别的页面。 th:include="include类似于jsp的include
需要和t:fragment联动使用-->
    <th:block th:include="include :: header('项目任务分配')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                            项目名称：<input type="text" name="projectName"/>
                        </li>
                        <li>
                            项目类别：<input type="text" name="projectCategory"/>
                        </li>
                        <li>
                            所属客户：<input type="text" name="clientName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <!--<div class="btn-group-sm" id="toolbar" role="group">-->
        <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="cyq:itask:add">-->
                <!--<i class="fa fa-plus"></i> 新增-->
            <!--</a>-->
            <!--<a class="btn btn-primary single disabled" onclick="$.operate.edit()"-->
               <!--shiro:hasPermission="cyq:itask:edit">-->
                <!--<i class="fa fa-edit"></i> 修改-->
            <!--</a>-->
            <!--<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"-->
               <!--shiro:hasPermission="cyq:itask:remove">-->
                <!--<i class="fa fa-remove"></i> 删除-->
            <!--</a>-->
        <!--</div>-->

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('cyq:itask:edit')}]];
    // var removeFlag = [[${@permission.hasPermi('cyq:itask:remove')}]];
    var queryFlag = [[${@permission.hasPermi('cyq:item:detail')}]];
    // var datas = [[${@dict.getType('sys_normal_disable')}]];
    var prefix = ctx + "cyq/item/itask";

    $(function () {
        var options = {
            url: prefix + "/list",
            // createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            // removeUrl: prefix + "/remove",
            detailUrl: prefix+"/detail/{id}",
            sortName: "projectCreateTime",
            modalName: "任务分配",
            columns: [{
                checkbox: true
            },
                {
                    field: 'projectId',
                    title: '项目编号'
                },
                {
                    field: 'projectName',
                    title: '项目名称',
                },
                {
                    field: 'projectCategory',
                    title: '项目类别',
                },
                {
                    field: 'clientName',
                    title: '所属客户',
                },
                {
                    field: 'projectState',
                    title: '项目状态',
                },{
                    field: 'projectCreateBy',
                    title: '创建人',
                },
                {
                    field: 'projectCreateTime',
                    title: '创建时间',
                    sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-info btn-xs ' + queryFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.projectId + '\')"><i class="fa fa-key"></i>查看</a>');
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.projectId + '\')"><i class="fa fa-edit"></i>项目分配</a> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.typeId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>